<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //用promise对对象获取数据
        //es2015提供的内置对象
        let target="hello,promise"
        let p=new Promise((resolve)=>{
            setTimeout(() => {
                resolve(target);
            }, 500);
        })
        p.then((d)=>{
            console.log(d)
        })
    </script>
</body>
</html>